<%--
  Created by IntelliJ IDEA.
  User: 70481
  Date: 2019/9/18
  Time: 20:12
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>日志管理</title>
    <link href="${pageContext.request.contextPath}/layui/css/layui.css" rel="stylesheet" type="text/css">
</head>

<body>
<table id="myTable" lay-filter="myTable"></table>



</body>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.4.1.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/layui/layui.js"></script>

<script type="text/javascript">

    layui.use("table",function(){
        var table = layui.table;

        table.render({
            elem:"#myTable",
            url:"${pageContext.request.contextPath}/log/selectCmfzLog",
            page:"true",
            toolbar:"#tool",
            cols:[[
                {title:"编号",field:"logId"},
                {title:"操作者",field:"admin",templet:"#titleTpl"},
                {title:"造作描述",field:"logContent"},
                {title:"操作类型",field:"logType"},
                {title:"时间",field:"logDate"},
            ]]

        })

        table.on("toolbar(myTable)",function (obj) {
            var table = layui.table;

            // 获取输入框和选择框中的值
            var params = $("#searchName").val()
            var par = $("#select").val();
            table.reload("myTable",{
                where:{"name":params,"type":par}
            })
        })
    })

</script>

<script type="text/html" id="titleTpl">
    {{d.admin.adminName}}
</script>


<script type="text/html" id="tool">
   <div class="layui-form-item">
       <div class="layui-inline">
           <input type="text" name="name" id="searchName" style="height: 30px">
       </div>
       <div class="layui-inline">
            <select name="type" id="select">
                <option value="">请选择</option>
                <option value="select">select</option>
                <option value="insert">insert</option>
                <option value="update">update</option>
                <option value="delete">delete</option>
                <option value="export">export</option>
            </select>
       </div>
       <div class="layui-inline">
           <button type="button" class="layui-btn  layui-btn-sm layui-btn-radius layui-btn-normal" lay-event="search">
               <i class="layui-icon layui-icon-search"></i>搜索</button>
       </div>

   </div>
</script>


</html>
